package org.BUPT.infrastructure.persistent.DAO;

import org.BUPT.infrastructure.persistent.po.Question_Tag;
import org.BUPT.infrastructure.persistent.po.Question_TagPrimaryKey;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface Question_TagDAO extends CrudRepository<Question_Tag, Question_TagPrimaryKey> {
    @Query("select qt.question_tagPrimaryKey.tagName " +
            "from Question_Tag qt  " +
            "where qt.question_tagPrimaryKey.questionId= :questionId")
    List<String> getTagNamesByQuestionId(@Param("questionId") int questionId);
}
